<template>
  <div>
    <el-main>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
      <el-form-item label="工单编号:">
        <el-input v-model="formInline.user" placeholder="请输入"></el-input>
      </el-form-item>
      <el-form-item label="工单状态:">
        <el-select v-model="formInline.region" placeholder="请选择">
          <el-option label="代办" value="shanghai"></el-option>
          <el-option label="进行" value="beijing"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="onSubmit"
          >查询</el-button
        >
      </el-form-item>
    </el-form>
    <div class="button">
      <el-button type="primary" icon="el-icon-circle-plus-outline" style="background-color:#ff772f;border:none ">新建</el-button>

    </div>
    <div class="buslist">
      <el-table highlight-current-row :data="tableData" style="width: 100%">
        <el-table-column type="index" label="序号" width="80"> </el-table-column>
        <el-table-column prop="taskCode" label="工单编号"> </el-table-column>
        <el-table-column prop="innerCode" label="设备编号"> </el-table-column>
        <el-table-column prop="name" label="工单类型"> </el-table-column>
        <el-table-column prop="name" label="工单方式"> </el-table-column>
        <el-table-column prop="name" label="工单状态"> </el-table-column>
        <el-table-column prop="userName" label="运营人员"> </el-table-column>
        <el-table-column prop="updateTime" label="创建日期"> </el-table-column>
        <el-table-column prop="name" label="操作"> </el-table-column>
      </el-table>
    </div>
    </el-main>

  </div>
</template>

<script>
import { TaskSearch } from '@/api/user'
export default {
  data () {
    return {
      formInline: {
        user: '',
        region: ''
      },
      pageParams: {
        pageIndex: 1,
        pageSize: 10,
        // 是否是运维工单 运营为true 运维为false
        isRepair: true
      },
      tableData: []
    }
  },
  created () {
    this.TaskSearch()
  },
  methods: {
    onSubmit () {
      console.log('submit!')
    },
    async TaskSearch () {
      const res = await TaskSearch({ ...this.pageParams })
      console.log(res)
      this.tableData = res.data.currentPageRecords
    }
  }
}
</script>

<style lang="less" scoped>
.demo-form-inline {
  text-align: left;
  background-color: #fff;
  height: 40px;
  padding: 15px;
  font-weight: 800;
}
.button {
  background-color: #fff;
  margin-top: 20px;
  padding-left: 20px;
  line-height: 80px;
  text-align: left;
}
.buslist {
  .el-table thead {
    line-height: 80px;
  }
}
.el-form-item {
  line-height: 20px;
}
.el-main{
  line-height: normal;
  padding: 0;
}
</style>
